
public class DistanceItem implements Comparable{
	private String name;
	private double distance;
	
	public DistanceItem(String name, double distance){
		this.name = name;
		this.distance = distance;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public double getDistance() {
		return distance;
	}
	public void setDistance(double distance) {
		this.distance = distance;
	}
	
	@Override
	public String toString() {
		return this.name+":" + this.distance;
	}
	@Override
	public int compareTo(Object o) {
		DistanceItem d2 = (DistanceItem)o;
		if(this.distance > d2.distance){
			return 1;
		}else{
			return -1;
		}
	}
	
}
